<template>
    <!--联系人详情页面-->
    <div>
        <div style="border:1px solid #BFBFBF;padding: 10px;background-color: white;height: 140px">
            <el-form v-model="linkmanlist" :label-position="labelPosition" >
                <div>
                    <el-row :gutter="20" style="height:41px">
                        <el-col :span="6" >
                            <el-form-item>
                                <i class="el-icon-s-custom" style="margin-left: 10px; font-size: 19px;"></i>
                                <span style="font-weight: bold;font-size: 18px;margin-left: 10px">{{linkmanlist.linkmanName}}</span>
                                <span style="display: none">id:{{linkmanlist.linkmanId}}</span>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6" :offset="12">
                            <el-form-item>
                                <el-button class="el-icon-edit" style="margin-left: 100px;"
                                           @click="xgclient(linkmanlist.linkmanId)">编辑</el-button>
                                <el-button class="el-icon-back" @click="gotoMenufh">返回</el-button>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </div>
                <!--下-->
                <div style="border-top: 1px solid #DDDDDD;margin-top: 10px">
                    <div style="height: 150px;margin-left: 10px;">
                        <el-row type="flex" :gutter="20" style="margin-top: 20px">
                            <el-col :span="2">
                                <span style="color: gray">客户名称：</span>
                            </el-col>
                            <el-col :span="10">
                                <span style="color: black">{{linkmanlist.clientId.clientName}}</span>
                            </el-col>
                            <el-col :span="2">
                                <span style="color: gray">职务：</span>
                            </el-col>
                            <el-col :span="4">
                                <span style="color: black">{{linkmanlist.linkmanPosition}}</span>
                            </el-col>
                        </el-row>
                        <el-row type="flex" :gutter="20" style="margin-top: 15px">
                            <el-col :span="2">
                                <span style="color: gray">手机：</span>
                            </el-col>
                            <el-col :span="10">
                                <span style="color: black">{{linkmanlist.linkmanMobile}}</span>
                            </el-col>
                            <el-col :span="2">
                                <span style="color: gray">负责人：</span>
                            </el-col>
                            <el-col :span="4">
                                <span style="color: black">{{linkmanlist.empId.empName}}</span>
                            </el-col>
                        </el-row>
                        <el-row type="flex" :gutter="20" style="margin-top: 15px">
                        </el-row>
                    </div>
                </div>
            </el-form>
        </div>
        <!--联系人详情-->
        <div style="margin-top: 5px;border: 1px solid #BFBFBF;background-color: white;">
            <div>
                <template>
                    <el-tabs v-model="activeName2" type="card">
                        <el-tab-pane label="基本信息" name="first" style="height: 410px;">
                            <div class="shugan" style="margin-left: 20px;"></div>
                            <span style="margin-left: 10px;font-size: 14px;">基本信息</span>
                            <el-form :model="linkmanlist" style="margin-left: 20px;" :label-position="labelPosition" >
                                <div>
                                    <div style="height: 150px;margin-left: 10px;">
                                        <el-row type="flex" :gutter="20" style="margin-top: 20px">
                                            <el-col :span="3">
                                                <span style="color: gray">姓名：</span>
                                            </el-col>
                                            <el-col :span="10">
                                                <span style="color: black">{{linkmanlist.linkmanName}}</span>
                                            </el-col>
                                            <el-col :span="3">
                                                <span style="color: gray">客户名称：</span>
                                            </el-col>
                                            <el-col :span="4">
                                                <span style="color: black">{{linkmanlist.clientId.clientName}}</span>
                                            </el-col>
                                        </el-row>
                                        <el-row type="flex" :gutter="20" style="margin-top: 15px">
                                            <el-col :span="3">
                                                <span style="color: gray">手机：</span>
                                            </el-col>
                                            <el-col :span="10">
                                                <span style="color: black">{{linkmanlist.linkmanMobile}}</span>
                                            </el-col>
                                            <el-col :span="3">
                                                <span style="color: gray">电话：</span>
                                            </el-col>
                                            <el-col :span="4">
                                                <span style="color: black">{{linkmanlist.linkmanPhone}}</span>
                                            </el-col>
                                        </el-row>
                                        <el-row type="flex" :gutter="20" style="margin-top: 20px">
                                            <el-col :span="3">
                                                <span style="color: gray">电子邮箱：</span>
                                            </el-col>
                                            <el-col :span="10">
                                                <span style="color: black">{{linkmanlist.emailAddress}}</span>
                                            </el-col>
                                            <el-col :span="3">
                                                <span style="color: gray">是否关键决策人：</span>
                                            </el-col>
                                            <el-col :span="4">
                                                <span style="color: black">{{linkmanlist.keyPolicymaker}}</span>
                                            </el-col>
                                        </el-row>
                                        <el-row type="flex" :gutter="20" style="margin-top: 20px">
                                            <el-col :span="3">
                                                <span style="color: gray">职务：</span>
                                            </el-col>
                                            <el-col :span="10">
                                                <span style="color: black">{{linkmanlist.linkmanPosition}}</span>
                                            </el-col>
                                            <el-col :span="3">
                                                <span style="color: gray">性别：</span>
                                            </el-col>
                                            <el-col :span="4">
                                                <span style="color: black">{{linkmanlist.linkmanSex}}</span>
                                            </el-col>
                                        </el-row>
                                        <el-row type="flex" :gutter="20" style="margin-top: 20px">
                                            <el-col :span="3">
                                                <span style="color: gray">地址：</span>
                                            </el-col>
                                            <el-col :span="10">
                                                <span style="color: black">{{linkmanlist.linkmanSite}}</span>
                                            </el-col>
                                            <el-col :span="3">
                                                <span style="color: gray">下次联系时间：</span>
                                            </el-col>
                                            <el-col :span="4">
                                                <span style="color: black">{{linkmanlist.linkmanTime | formatDate}}</span>
                                            </el-col>
                                        </el-row>
                                        <el-row type="flex" :gutter="20" style="margin-top: 20px">
                                            <el-col :span="3">
                                                <span style="color: gray">备注：</span>
                                            </el-col>
                                            <el-col :span="10">
                                                <span style="color: black">{{linkmanlist.linkmanRemark}}</span>
                                            </el-col>
                                        </el-row>
                                        <el-row type="flex" :gutter="20" style="margin-top: 15px">
                                        </el-row>
                                    </div>
                                </div>
                            </el-form>
                        </el-tab-pane>
                        <el-tab-pane label="联系提醒" name="lxtx">
                            <div>
                                <div style="width: 970px;margin: 5px 70px">
                                    <div>
                                        <el-button style="margin-left: 990px" size="small" type="primary" @click="lxtxann">新建联系提醒</el-button>
                                    </div>
                                    <el-dialog style="width: 1400px;margin: 0 auto;" title="新建联系提醒" :visible.sync="lxtxtankuan">
                                        <div class="shugan"></div>
                                        <span style="margin-left: 10px;font-size: 14px;">基本信息</span>
                                        <br/>
                                        <el-form :model="lxtxList" style="margin-top:10px;margin-left: 20px;" size="mini">
                                            <el-row>
                                                <el-form-item style="display: none" prop="clientId"><!--客户id-->
                                                    <el-input v-model="lxtxList.clientId" style="display: none"></el-input>
                                                </el-form-item>
                                                <el-col :span="13">
                                                    <el-form-item style="width:250px;" prop="empId">
                                                        <label slot="label" style="font-size: 13px">负责人:</label>
                                                        <el-input :disabled="true" v-model="lxtxList.empId.empName"></el-input>
                                                    </el-form-item>
                                                </el-col>
                                                <el-col :span="9">
                                                    <el-form-item style="width:200px" prop="relationwarnZt">
                                                        <label slot="label" style="font-size: 13px">状态:</label><br/>
                                                        <el-radio v-model="lxtxList.relationwarnZt" label="0">新增</el-radio>
                                                        <el-radio v-model="lxtxList.relationwarnZt" label="1">完成</el-radio>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                            <el-row>
                                                <el-col :span="13">
                                                    <el-form-item style="width:250px;" prop="relationwarnTime">
                                                        <label slot="label" style="font-size: 13px">联系时间:</label>
                                                        <el-date-picker v-model="lxtxList.relationwarnTime" align="right" type="datetime"
                                                                        style="width: 250px" placeholder="选择日期"
                                                                        :picker-options="pickerOptions">
                                                        </el-date-picker>
                                                    </el-form-item>
                                                </el-col>
                                                <el-col :span="9">
                                                    <el-form-item style="width:200px" prop="relationwarnLx">
                                                        <label slot="label" style="font-size: 13px">联系类型:</label>
                                                        <el-select v-model="lxtxList.relationwarnLx" placeholder="请选择" style="width:250px;">
                                                            <el-option v-for="item in lxlx" :key="item.valuelx"
                                                                       :label="item.label" :value="item.valuelx">
                                                            </el-option>
                                                        </el-select>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                            <el-row>
                                                <el-col :span="13">
                                                    <el-form-item style="width:250px;" prop="linkmanId">
                                                        <label slot="label" style="font-size: 13px">客户联系人:</label>
                                                        <el-input :disabled="true" v-model="lxtxList.linkmanId.linkmanName"></el-input>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                            <el-row>
                                                <el-col :span="24">
                                                    <el-form-item style="width:250px;" prop="relationwarnNr">
                                                        <label style="font-size: 13px">内容:</label>
                                                        <textarea placeholder="请填写本次联系计划目标内容"
                                                                  v-model="lxtxList.relationwarnNr" style="width: 595px; height: 70px;"></textarea>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                        </el-form>
                                        <div slot="footer" style="text-align: center" class="dialog-footer">
                                            <el-button @click="lxtxtankuan = false">取 消</el-button>
                                            <el-button type="primary" @click="addlxtx">确 定</el-button>
                                        </div>
                                    </el-dialog>

                                    <el-dialog style="width: 1400px;margin: 0 auto;" title="编辑联系提醒" :visible.sync="xglxtxtankuan">
                                        <div class="shugan"></div>
                                        <span style="margin-left: 10px;font-size: 14px;">基本信息</span>
                                        <br/>
                                        <el-form :model="lxtxList" style="margin-top:10px;margin-left: 20px;" size="mini">
                                            <el-row>
                                                <el-form-item style="" prop="clientId"><!--客户id-->
                                                    <el-input v-model="lxtxList.clientId" style=""></el-input>
                                                </el-form-item>
                                                <el-col :span="13">
                                                    <el-form-item style="width:250px;" prop="clientName">
                                                        <label slot="label" style="font-size: 13px">客户名称:</label>
                                                        <el-input :disabled="true" v-model="lxtxList.clientId.clientName"></el-input>
                                                    </el-form-item>
                                                </el-col>
                                                <el-col :span="9">
                                                    <el-form-item style="width:250px;" prop="empId">
                                                        <label slot="label" style="font-size: 13px">负责人:</label>
                                                        <el-input :disabled="true" v-model="lxtxList.empId.empName"></el-input>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                            <el-row>
                                                <el-col :span="13">
                                                    <el-form-item style="width:250px;" prop="relationwarnTime">
                                                        <label slot="label" style="font-size: 13px">联系时间:</label>
                                                        <el-date-picker v-model="lxtxList.relationwarnTime" align="right" type="datetime"
                                                                        style="width: 250px" placeholder="选择日期"
                                                                        :picker-options="pickerOptions">
                                                        </el-date-picker>
                                                    </el-form-item>
                                                </el-col>
                                                <el-col :span="9">
                                                    <el-form-item style="width:200px" prop="relationwarnLx">
                                                        <label slot="label" style="font-size: 13px">联系类型:</label>
                                                        <el-select v-model="lxtxList.relationwarnLx" placeholder="请选择" style="width:250px;">
                                                            <el-option v-for="item in lxlx" :key="item.valuelx"
                                                                       :label="item.label" :value="item.valuelx">
                                                            </el-option>
                                                        </el-select>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                            <el-row>
                                                <el-col :span="13">
                                                    <el-form-item style="width:250px;" prop="linkmanId">
                                                        <label slot="label" style="font-size: 13px">客户联系人:</label>
                                                        <el-input :disabled="true" v-model="lxtxList.linkmanId.linkmanName"></el-input>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                            <el-row>
                                                <el-col :span="24">
                                                    <el-form-item style="width:250px;" prop="relationwarnNr">
                                                        <label style="font-size: 13px">内容:</label>
                                                        <textarea placeholder="请填写本次联系计划目标内容"
                                                                  v-model="lxtxList.relationwarnNr" style="width: 595px; height: 70px;"></textarea>
                                                    </el-form-item>
                                                </el-col>
                                            </el-row>
                                        </el-form>
                                        <div slot="footer" style="text-align: center" class="dialog-footer">
                                            <el-button @click="xglxtxtankuan = false">取 消</el-button>
                                            <el-button type="success" @click="bjlxtxzt1" v-if="lxtxList.relationwarnZt==0">完 成 提 醒</el-button>
                                            <el-button type="success" @click="bjwlxtxzt2" v-if="lxtxList.relationwarnZt==1">重 新 标 记</el-button>
                                            <el-button type="primary" @click="bjlxtx">保 存</el-button>
                                        </div>
                                    </el-dialog>
                                </div>
                                <el-collapse v-model="activeNames" style="width:1100px; margin-left: 80px;" @change="handleChange">
                                    <el-collapse-item v-if="this.lxtxLists[0]!=null" class="lx" title="正在进行中 >" name="1">
                                        <div class="divs" v-for="(item, i) in lxtxLists" :key="item.relationwarnId">
                                            <el-col :span="13">
                                                <span style="margin-left: 30px;" @click="lxtxann2(item)">{{i+1}}、 联系【{{item.linkmanId.linkmanName}}】</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <span>{{item.empId.empName}}</span>
                                            </el-col>
                                            <el-col :span="5" class="ysclass">
                                                <span>{{item.relationwarnTime | formatDate}}</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <div style="margin-top:-5px;">
                                                    <el-button type="text" @click="bjlxtxzt(item)" v-if="item.relationwarnZt==0">标记完成</el-button>
                                                    <el-button type="text" @click="bjwlxtxzt(item)" v-if="item.relationwarnZt==1">重新标记</el-button>
                                                </div>
                                            </el-col>
                                            <el-col :span="2"><span style="margin-left: 25px;" @click="sclxtx(item)">删除</span></el-col>
                                        </div>
                                    </el-collapse-item>

                                    <el-collapse-item v-if="this.lxtxListser[0]!=null" class="lx2" title="已完成 >" name="2">
                                        <div class="divs1" v-for="(items,i) in lxtxListser" :key="items.relationwarnId">
                                            <el-col :span="13">
                                                <!--                                                <template slot-scope="sp">v-html="sp.row.clientName" @click="todetails(sp.row)"-->
                                                <span style="margin-left: 30px;" @click="lxtxann2(items)">{{i+1}}、 联系【{{items.linkmanId.linkmanName}}】</span>
                                                <!--                                                </template>-->
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <span>{{items.empId.empName}}</span>
                                            </el-col>
                                            <el-col :span="5" class="ysclass">
                                                <span>{{items.relationwarnTime | formatDate}}</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <div style="margin-top:-5px;">
                                                    <el-button type="text" @click="bjlxtxzt(items)" v-if="items.relationwarnZt==0">标记完成</el-button>
                                                    <el-button type="text" @click="bjwlxtxzt(items)" v-if="items.relationwarnZt==1">重新标记</el-button>
                                                </div>
                                            </el-col>
                                            <p>
                                                <el-col :span="2"><span style="margin-left: 25px;" @click="sclxtx(items)">删除</span></el-col>
                                            </p>
                                        </div>
                                    </el-collapse-item>

                                    <el-collapse-item v-if="this.lxtxListssan[0]!=null" class="lx3" title="已延期 >" name="3">
                                        <div class="divs2" v-for="(itemss,i) in lxtxListssan" :key="itemss.relationwarnId">
                                            <el-col :span="13">
                                                <!--                                                <template slot-scope="sp">v-html="sp.row.clientName" @click="todetails(sp.row)"-->
                                                <span style="margin-left: 30px;" @click="lxtxann2(itemss)">{{i+1}}、 联系【{{itemss.linkmanId.linkmanName}}】</span>
                                                <!--                                                </template>-->
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <span>{{itemss.empId.empName}}</span>
                                            </el-col>
                                            <el-col :span="5" class="ysclass">
                                                <span>{{itemss.relationwarnTime | formatDate}}</span>
                                            </el-col>
                                            <el-col :span="2" class="ysclass">
                                                <div style="margin-top:-5px;">
                                                    <el-button style="padding-top: -25px;" type="text" @click="bjlxtxzt(itemss)" v-if="itemss.relationwarnZt==0">标记完成</el-button>
                                                    <el-button type="text" @click="bjwlxtxzt(itemss)" v-if="itemss.relationwarnZt==1">重新标记</el-button>
                                                </div>
                                            </el-col>
                                            <el-col :span="2"><span style="margin-left: 25px;" @click="sclxtx(itemss)">删除</span></el-col>
                                        </div>
                                    </el-collapse-item>
                                </el-collapse>
                            </div>
                        </el-tab-pane>
                        <el-tab-pane label="附件" name="eight" style="height: 410px;">
                            <div>
                                <!--附件信息-->
                                <template>
                                    <el-table border style="width: 900px; margin: 0 auto;" height="350">
                                        <el-table-column fixed prop="date" label="附件名称" width="200">
                                        </el-table-column>
                                        <el-table-column prop="name" label="附件大小" width="100">
                                        </el-table-column>
                                        <el-table-column prop="province" label="上传人" width="200">
                                        </el-table-column>
                                        <el-table-column prop="province" label="上传时间" width="200">
                                        </el-table-column>
                                        <el-table-column prop="province" label="操作" width="200">
                                        </el-table-column>
                                    </el-table>
                                </template>
                            </div>
                        </el-tab-pane>
                        <el-tab-pane label="操作记录" name="nine" style="height: 410px;">
                            <div class="block">
                                <div class="radio" style="margin-left: 38px;">
                                    <el-radio-group v-model="reverse">
                                        <el-radio :label="true">倒序</el-radio>
                                        <el-radio :label="false">正序</el-radio>
                                    </el-radio-group>
                                </div>
                                <el-timeline :reverse="reverse" style="margin-top: 40px;">
                                    <el-timeline-item v-for="(item) in activities"
                                                      :key="item.operationId" :timestamp="item.operationTime | formatDate">
                                        <el-col :span="3">
                                            操作人:
                                            <span style="color: #409EFF;margin-right: 30px;">{{item.empId.empName}}</span>
                                        </el-col>
                                        <el-col :span="4">
                                            {{item.operationContent}}
                                        </el-col>
                                        <el-col :span="2">
                                            <i class="el-icon-s-custom" style="margin-left: 15px; font-size: 15px;"></i>
                                            <span style="color: #409EFF;margin-left: 10px;">{{item.linkmanId.linkmanName}}</span>
                                        </el-col>
                                    </el-timeline-item>
                                </el-timeline>
                            </div>
                        </el-tab-pane>
                    </el-tabs>
                </template>
            </div>
        </div>
    </div>
</template>

<script>
    import {formatTimeToStr} from '../router//format.js';
    import Crypto  from '../router//secret.js'
    export default {
        name: "TfyLinkmanParticularsPage",
        data() {
            return {
                //联系类型
                lxlx: [{
                    valuelx: '打电话',
                    label: '打电话'
                }, {
                    valuelx: '发邮件',
                    label: '发邮件'
                }, {
                    valuelx: '发短信',
                    label: '发短信'
                }, {
                    valuelx: '见面拜访',
                    label: '见面拜访'
                }, {
                    valuelx: '汇报记录',
                    label: '汇报记录'
                }, {
                    valuelx: '会晤',
                    label: '会晤'
                }, {
                    valuelx: '活动',
                    label: '活动'
                }, {
                    valuelx: '商务宴会',
                    label: '商务宴会'
                }, {
                    valuelx: '其他',
                    label: '其他'
                }],
                valuelx: '',
                khlxr:[],//客户联系人
                activeNames: ['1','2','3'],//联系提醒
                /*对齐方式*/
                labelPosition:'left',
                clientlist: {//客户表单
                    clientId:0,
                    clientName:'',//公司名称
                    clientIndustry:'',//公司行业
                    clientSource:'',//客户来源
                    clientPhone:'',//客户电话
                    clientMobile:'',//客户手机
                    clientUrl:'',//客户网址
                    clientRank:'',//客户级别
                    clientSite:'',//客户地址
                    establishPerson:'',//下次联系时间
                    clientRemark:'',//客户备注
                    linkmanId:{//联系人
                        linkmanId:0,
                        linkmanName:'',
                        linkmanMobile:'',
                        linkmanPosition:'',
                        linkmanPeople:'',
                    },
                    empId:{
                        empId:0,
                        empName:''
                    },
                    operationId:{//操作表
                        operationId:0,
                        operationContent:'',
                        operationTime:'',
                    },
                    relationwarnId:{//联系提醒表
                        relationwarnId:0,
                        relationwarnNr:'',
                        relationwarnLx:'',
                        relationwarnTime:'',
                        relationwarnZt:'0',
                        relationwarnJd:0,
                    }
                },
                lxtxList:{//联系提醒表
                    relationwarnId:0,
                    relationwarnNr:'',
                    relationwarnLx:'',
                    relationwarnTime:'',
                    relationwarnZt:'0',
                    relationwarnJd:0,
                    empId:{//员工表
                        empId:0,
                        empName:''
                    },
                    clientId: {//客户表单
                        clientId: 0,
                        clientName: '',//公司名称
                        clientIndustry: '',//公司行业
                        clientSource: '',//客户来源
                        clientPhone: '',//客户电话
                        clientMobile: '',//客户手机
                        clientUrl: '',//客户网址
                        clientRank: '',//客户级别
                        clientSite: '',//客户地址
                        establishPerson: '',//下次联系时间
                        clientRemark: '',//客户备注
                    },
                    linkmanId: {//联系人
                        linkmanId: 0,
                        linkmanName: '',
                        linkmanMobile: '',
                        linkmanPosition: '',
                        linkmanPeople: '',
                    },
                    clueId:{
                        clueId:0,
                        clueName:'',
                        clueSource:'',
                        cluePhone:'',
                        clueMobile:'',
                        clueSite:'',
                        clueEstablishtime:'',
                        clueRemark:'',
                        clueLinkmanname:'',
                        clueLinkmansj:'',
                        clueSz:'',
                    }
                },
                lxtxLists:{//联系提醒表2
                    relationwarnId:0,
                    relationwarnNr:'',
                    relationwarnLx:'',
                    relationwarnTime:'',
                    relationwarnZt:'0',
                    relationwarnJd:0,
                    empId:{//员工表
                        empId:0,
                        empName:''
                    },
                    clientId: {//客户表单
                        clientId: 0,
                        clientName: '',//公司名称
                        clientIndustry: '',//公司行业
                        clientSource: '',//客户来源
                        clientPhone: '',//客户电话
                        clientMobile: '',//客户手机
                        clientUrl: '',//客户网址
                        clientRank: '',//客户级别
                        clientSite: '',//客户地址
                        establishPerson: '',//下次联系时间
                        clientRemark: '',//客户备注
                    },
                    linkmanId: {//联系人
                        linkmanId: 0,
                        linkmanName: '',
                        linkmanMobile: '',
                        linkmanPosition: '',
                        linkmanPeople: '',
                    },
                    clueId:{
                        clueId:0,
                        clueName:'',
                        clueSource:'',
                        cluePhone:'',
                        clueMobile:'',
                        clueSite:'',
                        clueEstablishtime:'',
                        clueRemark:'',
                        clueLinkmanname:'',
                        clueLinkmansj:'',
                        clueSz:'',
                    }
                },
                lxtxListser:{//联系提醒表2
                    relationwarnId:0,
                    relationwarnNr:'',
                    relationwarnLx:'',
                    relationwarnTime:'',
                    relationwarnZt:'0',
                    relationwarnJd:0,
                    empId:{//员工表
                        empId:0,
                        empName:''
                    },
                    clientId: {//客户表单
                        clientId: 0,
                        clientName: '',//公司名称
                        clientIndustry: '',//公司行业
                        clientSource: '',//客户来源
                        clientPhone: '',//客户电话
                        clientMobile: '',//客户手机
                        clientUrl: '',//客户网址
                        clientRank: '',//客户级别
                        clientSite: '',//客户地址
                        establishPerson: '',//下次联系时间
                        clientRemark: '',//客户备注
                    },
                    linkmanId: {//联系人
                        linkmanId: 0,
                        linkmanName: '',
                        linkmanMobile: '',
                        linkmanPosition: '',
                        linkmanPeople: '',
                    },
                    clueId:{
                        clueId:0,
                        clueName:'',
                        clueSource:'',
                        cluePhone:'',
                        clueMobile:'',
                        clueSite:'',
                        clueEstablishtime:'',
                        clueRemark:'',
                        clueLinkmanname:'',
                        clueLinkmansj:'',
                        clueSz:'',
                    }
                },
                lxtxListssan:{//联系提醒表2
                    relationwarnId:0,
                    relationwarnNr:'',
                    relationwarnLx:'',
                    relationwarnTime:'',
                    relationwarnZt:'0',
                    relationwarnJd:0,
                    empId:{//员工表
                        empId:0,
                        empName:''
                    },
                    clientId: {//客户表单
                        clientId: 0,
                        clientName: '',//公司名称
                        clientIndustry: '',//公司行业
                        clientSource: '',//客户来源
                        clientPhone: '',//客户电话
                        clientMobile: '',//客户手机
                        clientUrl: '',//客户网址
                        clientRank: '',//客户级别
                        clientSite: '',//客户地址
                        establishPerson: '',//下次联系时间
                        clientRemark: '',//客户备注
                    },
                    linkmanId: {//联系人
                        linkmanId: 0,
                        linkmanName: '',
                        linkmanMobile: '',
                        linkmanPosition: '',
                        linkmanPeople: '',
                    },
                    clueId:{
                        clueId:0,
                        clueName:'',
                        clueSource:'',
                        cluePhone:'',
                        clueMobile:'',
                        clueSite:'',
                        clueEstablishtime:'',
                        clueRemark:'',
                        clueLinkmanname:'',
                        clueLinkmansj:'',
                        clueSz:'',
                    }
                },
                /*保存传过来的row*/
                linkmanlist:{
                    linkmanId:0,
                    linkmanName:'',//联系人名称
                    linkmanPhone:'',//联系人电话号码
                    linkmanMobile:'',//联系人手机号码
                    emailAddress:'',//联系人电子邮箱
                    keyPolicymaker:'',//联系人是否关键决策人
                    linkmanPosition:'',//联系人职位
                    linkmanSex:'',//联系人性别
                    linkmanSite:'',//联系人地址
                    linkmanTime:'',//联系人下次联系时间
                    linkmanRemark:'',//联系人备注
                    linkmanBirthday:'',//联系人出生日期
                    clientId:{
                        clientId:0,
                        clientName:'',//公司名称
                    },
                    empId:{
                        empId:0,
                        empName:''
                    },
                    operationId:{
                        operationId:0,
                        operationContent:'',
                        operationTime:'',
                    }
                },
                bjjilutankuan:false,
                //快捷日期选择器
                pickerOptions: {
                    disabledDate(time) {
                        return time.getTime() < Date.now();
                    },
                    shortcuts: [{
                        text: '今天',
                        onClick(picker) {
                            picker.$emit('pick', new Date());
                        }
                    }]
                },
                /*是否显示记录值div*/
                jl:false,
                activeName2: 'first',
                //操作记录-时间线
                reverse: true,
                activities: [],
                radio: '0',//单选框x
                lxtxtankuan:false,//弹框
                xglxtxtankuan:false,//修改弹框
                checked1:false,//多选框
            };
        },
        methods: {
            lxtxann(){//联系提醒按钮
                this.lxtxList.empId = this.linkmanlist.empId;
                this.lxtxList.clientId = this.linkmanlist.clientId;
                this.lxtxList.relationwarnTime = null;
                this.lxtxList.relationwarnLx = null;
                this.lxtxList.relationwarnNr = null;
                this.lxtxtankuan = true;
            },
            lxtxann2(row){
                window.console.log(row)
                this.lxtxList= row;
                this.xglxtxtankuan = true;
            },
            todetails(){
            },
            handleChange(val) {//联系提醒
                console.log(val);
            },
            addlxtx(){//新增联系提醒
                window.console.log("对象:"+this.lxtxList.linkmanId)
                this.$axios.post("http://localhost:8088/addlxtx-list",this.lxtxList)
                    .then(() => {
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '新增成功!',
                        });
                        this.lxtxtankuan = false;
                        this.initData();
                    }).catch(() => {
                    this.$message({
                        showClose: true,
                        message: '新增失败',
                        type: 'error'
                    });
                })
            },
            bjlxtxzt1(){//修改联系提醒的完成状态
                this.$axios.post("http://localhost:8088/xgztlxtx-list", this.lxtxList)
                    .then(() => {
                        this.initData();
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '已标记为完成!',
                        });
                        this.xglxtxtankuan = false;
                    }).catch(() => {
                    this.$message({
                        showClose: true,
                        message: '失败',
                        type: 'error'
                    });
                })
            },
            bjwlxtxzt2(){//修改联系提醒的未完成状态
                this.$axios.post("http://localhost:8088/xgztwlxtx-list", this.lxtxList)
                    .then(() => {
                        this.initData();
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '已标记为未完成!',
                        });
                        this.xglxtxtankuan = false;
                    }).catch(() => {
                    this.$message({
                        showClose: true,
                        message: '失败',
                        type: 'error'
                    });
                })
            },
            bjlxtxzt(row){//修改联系提醒的完成状态
                this.lxtxList = row;
                this.$axios.post("http://localhost:8088/xgztlxtx-list", this.lxtxList)
                    .then(() => {
                        this.initData();
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '已标记为完成!',
                        });
                        this.xglxtxtankuan = false;
                    }).catch(() => {
                    this.$message({
                        showClose: true,
                        message: '失败',
                        type: 'error'
                    });
                })
            },
            bjwlxtxzt(row){//修改联系提醒的未完成状态
                this.lxtxList = row;
                this.$axios.post("http://localhost:8088/xgztwlxtx-list", this.lxtxList)
                    .then(() => {
                        this.initData();
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '已标记为未完成!',
                        });
                        this.xglxtxtankuan = false;
                    }).catch(() => {
                    this.$message({
                        showClose: true,
                        message: '失败',
                        type: 'error'
                    });
                })
            },
            bjlxtx(){//修改联系提醒
                this.$axios.post("http://localhost:8088/addlxtx-list", this.lxtxList)
                    .then(() => {
                        this.$message({
                            showClose: true,
                            type: 'success',
                            message: '修改成功!',
                        });
                        this.xglxtxtankuan = false;
                        this.initData();
                    }).catch(() => {
                    this.$message({
                        showClose: true,
                        message: '修改失败',
                        type: 'error'
                    });
                })
            },
            sclxtx(row){//删除联系提醒
                this.lxtxList = row;
                this.$confirm('确认删除该提醒?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.$axios.post("http://localhost:8088/sclxtx-list", this.lxtxList)
                        .then(() => {
                            this.$message({
                                showClose: true,
                                type: 'success',
                                message: '删除成功!',
                            });
                            this.initData();
                        }).catch(() => {
                        this.$message({
                            showClose: true,
                            message: '删除失败',
                            type: 'error'
                        });
                    })
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
            },
            xgclient(linkmanId){//客户修改方法
                linkmanId = escape(Crypto.set(linkmanId));//加密数据
                this.$router.push({
                    path:'/xjlxr',
                    query: {
                        linkmanId:linkmanId
                    }
                });
            },
            //联系人查询方法
            initData(){
                var id = Crypto.get(unescape(this.$route.query.row));
                this.$axios.get("http://localhost:8088/cxlinkmanclient-list",
                    {params:{linkmanId:id}}).then(v=>{
                    this.linkmanlist = v.data;
                    this.lxrcx(parseInt(id));//基本信息
                    this.czlist(parseInt(id));//操作
                    this.cxlxtx(id);
                    this.cxlxtx2(id);
                    this.cxlxtx3(id);
                    this.khlxrs(id);
                }).catch();
            },
            //联系人id-联系人查询
            khlxrs(id){
                this.$axios.post("http://localhost:8088/cxlinkmanclient-list",this.qs.stringify(
                    {linkmanId:parseInt(id)})).then(v=>{
                    this.lxtxList.linkmanId = v.data;
                    window.console.log("lxr查询："+this.lxtxList.linkmanId)
                }).catch();
            },
            cxlxtx(id){//根据联系人id查询联系提醒
                this.$axios.post("http://localhost:8088/lxridlxtx-list",this.qs.stringify(
                    {linkmanId:parseInt(id)})).then(v=>{
                    this.lxtxLists = v.data;
                }).catch();
            },
            cxlxtx2(id){//根据联系人id查询已完成联系提醒
                this.$axios.post("http://localhost:8088/lxrwcidlxtx-list",this.qs.stringify(
                    {linkmanId:parseInt(id)})).then(v=>{
                    this.lxtxListser = v.data;
                }).catch();
            },
            cxlxtx3(id){//根据联系人id查询已延期联系提醒
                this.$axios.post("http://localhost:8088/lxryqidlxtx-list",this.qs.stringify(
                    {linkmanId:parseInt(id)})).then(v=>{
                    this.lxtxListssan = v.data;
                }).catch();
            },
            //根据联系人id查询操作记录
            czlist(){
                var id = Crypto.get(unescape(this.$route.query.row));
                this.$axios.post("http://localhost:8088/findAlllxrcz-list",this.qs.stringify(
                    {linkmanId:parseInt(id)})).then(v=>{
                    this.activities = v.data;
                }).catch();
            },
            lxrcx(){
                var id = Crypto.get(unescape(this.$route.query.row));
                this.$axios.post("http://localhost:8088/cxlinkmanclient-list",this.qs.stringify(
                    {linkmanId:parseInt(id)})).then(v=>{
                    this.linkmanlist = v.data;
                }).catch();
            },
            gotoMenu(){
                this.$router.replace('/xjlxr')
            },
            gotoMenufh(){
                this.$router.replace('/tfylxr')
            },
            showjl(){
                this.jl=true;
            },
        },
        created: function () {//查询从列表页面传值初始化方法
            if(this.$route.query.row != null){
                this.initData();
                window.console.log(this.$route.query.row)
            }
        },
        filters:{//日期格式化
            formatDate: function(time) {
                if(time != null && time != ""){
                    var date = new Date(time);
                    return formatTimeToStr(date, "yyyy-MM-dd hh:mm:ss");
                }else{
                    return "";
                }
            }
        }
    }
</script>

<style scoped>
    *{
        margin:0;
        padding:0;
    }
    .el-scrollbar__wrap {
        overflow: scroll;
        width: 120%;
        height: 100%;
    }
    .apro:hover{
        color: #409EFF;
        cursor:pointer;
    }
    .shugan{
        border-left-color: rgb(70, 205, 207);
        border-left-width: 4.8px;
        height: 10px;
        border-left-style: solid;
        display: inline;
        font-size: 13px;
    }
    .lx div:hover{
        background-color: aliceblue;
        cursor:pointer;
    }
    .lx2 div:hover{
        background-color: #CEEFC8;
        cursor:pointer;
    }
    .lx3 div:hover{
        background-color: #e6e6e6;
        cursor:pointer;
    }
    .divs{
        border:1px solid darkturquoise;
        border-radius: 4px;
        height:40px;
        width: 1095px;
        font-size: 16px;
        padding-top: 10px;
        margin-bottom: 5px;
    }
    .divs1{
        border:1px solid #6BD089;
        border-radius: 4px;
        height:40px;
        width: 1095px;
        font-size: 16px;
        padding-top: 10px;
        margin-bottom: 5px;
    }
    .divs2{
        border:1px solid #A0A0A0;
        border-radius: 4px;
        height:40px;
        width: 1095px;
        font-size: 16px;
        padding-top: 10px;
        margin-bottom: 5px;
    }
    .ysclass{
        color: gray;
    }
</style>